/* 
 * File:   SkinFactory.h
 * Author: lgr013
 *
 * Created on 13 de octubre de 2014, 13:01
 */

#ifndef SKINFACTORY_H
#define	SKINFACTORY_H

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL2_gfxPrimitives.h>
#include <stdio.h>
#include <iostream>
#include <string>
#include <cmath>
#include <SDL2/SDL_render.h>
#include <Box2D/Box2D.h>
using namespace std;

class SkinFactory {
private:
    int centerX; //centro de masa en x
    int centerY; //centro de masa en y
    int sideBase; // lado o base 
    int sideBaseMin; //base menor del trapecio
    int sideHeight; //altura
    int sideQuantity; //cantidad de lados del poligono
    int escale; // radio 
    double angle1; //angulo del trapecio y paralelogramo
    double angle2; //segundo angulo del trapecio
    SDL_Renderer* gameRenderer;
    Uint8 redColor;
    Uint8 greenColor;
    Uint8 blueColor;
    Uint8 alphaColor;
    int pixelWidth;
    int pixelHeight;
    int unitWidth;
    int unitHeight;
    
                
public:
    //Constructores y Destructores
    SkinFactory();
    SkinFactory(SDL_Renderer* gRenderer);
    SkinFactory(SDL_Renderer* gRenderer,int pixelWidth,int pixelHeight,int unitWidth,int unitHeight);
    virtual ~SkinFactory();
    //Seters
    void setCenterX (int centerx);
    void setCenterY (int centery);
    void setSideBase (int sidebases);
    void setSideBaseMin (int sidebasemin);
    void setSideHeight (int sideheight);
    void setSideQuantity (int n);
    void setEscale (int eskale); 
    void setAngle1 (double angle1);
    void setAngle2 (double angle2); 
    void setGameRenderer (SDL_Renderer* grenderer);
    void setRColor (Uint8 rcolor);
    void setGColor (Uint8 gcolor);
    void setBColor (Uint8 bcolor);
    void setAColor (Uint8 acolor);
    //Geters
    int getCenterX ();
    int getCenterY ();
    int getSideBase ();
    int getSideBaseMin ();
    int getSideHeight ();
    int getSideQuantity ();
    int getEscale ();
    SDL_Renderer* getGameRenderer();
    Uint8 getRColor ();
    Uint8 getGColor ();
    Uint8 getBColor ();
    Uint8 getAColor ();
    //Funciones para crear las figuras
    bool makeRectangle(int x, int y,int sizex, int sizey, Uint8 r, Uint8 g,Uint8 b,Uint8 a); 
    bool makePolygon( int x, int y,int n, int escale,Uint8 r, Uint8 g,Uint8 b,Uint8 a);    
    bool makeCircle (int x, int y, int radius,Uint8 r, Uint8 g,Uint8 b,Uint8 a);
    bool makeParallellogram (int x, int y, int base, int height, double alpha, Uint8 r, Uint8 g,Uint8 b,Uint8 a);
    bool makeTrapezium (int x, int y, int base, int base2, int height, double alpha, double beta, Uint8 r, Uint8 g,Uint8 b,Uint8 a);

    //Funciones para crear las figuras con rotacion
    bool makeRectangle(b2Vec2 *pos, b2Vec2 *size, float rotation, Uint8 r, Uint8 g,Uint8 b,Uint8 a); 
    bool makePolygon(b2Vec2* pos, int n, int escale, float rotation, Uint8 r, Uint8 g,Uint8 b,Uint8 a);    
    bool makeCircle (b2Vec2* pos, int radius, float rotation, Uint8 r, Uint8 g,Uint8 b,Uint8 a);
    bool makeParallellogram (b2Vec2* pos, b2Vec2 *size, double alpha, float rotation,Uint8 r, Uint8 g,Uint8 b,Uint8 a);
    bool makeTrapezium (b2Vec2* pos, b2Vec2 *size, double alpha, double beta, float rotation,Uint8 r, Uint8 g,Uint8 b,Uint8 a);
    
};

#endif	/* SKINFACTORY_H */


